<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserCoinOpLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_coin_op_log', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('虚拟币操作用户ID');
            $table->smallInteger('coin')->default(0)->comment('虚拟币');
            $table->tinyInteger('op_type')->default(0)->comment('操作类型');
            $table->string('op_reason', 100)->default('')->comment('操作原因');
            $table->tinyInteger('admin_id')->default(0)->comment('操作员ID');
            $table->timestamps();
            $table->tinyInteger('flag')->default(1)->comment('状态');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_coin_op_log');
    }
}
